package com.example.shiwu.fragment;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.fragment.app.Fragment;

import com.example.shiwu.R;
import com.example.shiwu.model.MainInfo;
import com.example.shiwu.view.MainInfoView;

public class MainGatherFragment extends Fragment {
    private String content;
    private MainInfoView mainInfoView;
//    public MainInfoFragment(String content) {
//        this.content = content;
//    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_gather,container,false);

//        TextView txt_content = view.findViewById(R.id.main_sn);
//        txt_content.setText("1212121212");
       // initView(view);
        return view;
    }


    public void initView(View view) {
        mainInfoView = new MainInfoView((Activity) this.getContext(), R.layout.activity_maininfo,view);
        mainInfoView.createView();
        MainInfo mainInfo = new MainInfo();
        mainInfo.setChannel("12");
        mainInfo.setEdition("1");
        mainInfo.setFirmwareeDition("1");
        mainInfo.setGps("12,21");
        mainInfo.setSn("1212121212");
        mainInfo.setPowerSource("12v");
        mainInfoView.bindView(mainInfo);
    }

}
